import {NgModule} from "@angular/core";
import {RouterModule, Routes} from "@angular/router";
import {SharedModule} from "../../shared/shared.module";

import {PlatformAccountListComponent} from "./platform-account-list/platform-account-list.component";
import {PlatformAccountDetailComponent} from "./platform-account-detail/platform-account-detail.component";
import {PlatformAccountEditComponent} from "./platform-account-edit/platform-account-edit.component";
import {PlatformLogListComponent} from "./platform-log-list/platform-log-list.component";
import {PlatformLogDetailComponent} from "./platform-log-detail/platform-log-detail.component";

const routes: Routes = [
    {path: '', redirectTo: ' platform-account'},
    {path: 'platform-account', children: [
        {path: '', redirectTo: 'list'},
        {path: 'list', component: PlatformAccountListComponent},
        {path: 'add', component: PlatformAccountEditComponent},
        {path: 'modify/:code', component: PlatformAccountEditComponent},
        {path: 'detail/:code', component: PlatformAccountDetailComponent}
    ]},

    {path: 'platform-log', children: [
        {path: '', redirectTo: 'list'},
        {path: 'list', component: PlatformLogListComponent},
        {path: 'detail/:code', component: PlatformLogDetailComponent}
    ]}
];

@NgModule({
  imports: [
    SharedModule.forRoot(),
    RouterModule.forChild(routes)
  ],
  declarations: [
    PlatformAccountListComponent,
    PlatformAccountDetailComponent,
    PlatformAccountEditComponent,
    PlatformLogListComponent,
    PlatformLogDetailComponent,
  ],
  providers: []
})
export class PlatformModule {
}
